package com.wangsh.usersCenter.job;

import javax.annotation.Resource;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.wangsh.usersCenter.common.util.ConstatFinalUtil;
import com.wangsh.usersCenter.system.service.ISystemOperService;

/**
 * 定时执行
 * @author TeaBig
 */
@Component
public class JobService
{
	@Resource
	private ISystemOperService systemOperService;
	/**
	 * 定时执行的任务
	 */
	@Scheduled(cron = "0/5 * * * * ?")
	public void timer_1()
	{
		ConstatFinalUtil.SYS_LOGGER.info("===== 定时执行开始 ====");
		try
		{
			Thread.sleep(8000);
		} catch (InterruptedException e)
		{
			e.printStackTrace();
		}
		ConstatFinalUtil.SYS_LOGGER.info("===== 定时执行结束 ====");
	}
	
	/**
	 * 定时执行的任务
	 */
	@Scheduled(cron = "0/10 * * * * ?")
	public void operBatchIp()
	{
		ConstatFinalUtil.SYS_LOGGER.info("===== 定时执行开始(批量更新Ip) ====");
		this.systemOperService.operBatchIpService();
		ConstatFinalUtil.SYS_LOGGER.info("===== 定时执行结束(批量更新Ip) ====");
	}
}
